package com.mjp.learn.design.proxy.staticProxy;

import com.mjp.learn.design.proxy.Movable;

public class TimeProxy implements Movable {

    private Movable object;

    public TimeProxy(Movable object) {
        this.object = object;
    }

    @Override
    public void run() {
        long t1 = System.currentTimeMillis();
        object.run();
        long t2 = System.currentTimeMillis();
        System.out.println(t2 - t1);
    }
}
